//
//  NetworkModel.swift
//  YS
//
//  Created by 元穗 on 2017/5/19.
//  Copyright © 2017年 yuansui. All rights reserved.
//

import Foundation

// MARK: 键值对基类

public class BasePair<T> {
    var name: String = String();
    var val: T!;

    required public init(_ name: String, _ val: T) {
        self.name = name;
        self.val = val;
    }

    public func setName(_ n: String) {
        self.name = n;
    }

    public func getName() -> String {
        return name;
    }

    public func setVal(v: T?) {
        if v != nil {
            val = v;
        }
    }

    public func getVal() -> T {
        return val;
    }
}

// MARK: 通用键值对

public class CommonPair: BasePair<String> {

    required public init(_ name: String, _ val: String) {
        super.init(name, val);
    }

    public init(_ name: String, _ val: Int) {
        super.init(name, String(val));
    }

    public init(_ name: String, _ val: Double) {
        super.init(name, String(val));
    }
}

// MARK: 文件键值对

class FilePair: BasePair<String> {

}

// MARK: 流键值对

class StreamPair: BasePair<Stream> {

}








